package com.ruoyi.carService.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.api.domain.RescueMission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.carService.mapper.RescueMissionMapper;
import com.ruoyi.system.api.domain.RescueMission;
import com.ruoyi.carService.service.IRescueMissionService;

/**
 * 救援任务Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-09
 */
@Service
public class RescueMissionServiceImpl implements IRescueMissionService 
{
    @Autowired
    private RescueMissionMapper rescueMissionMapper;

    /**
     * 查询救援任务
     * 
     * @param orderDetailsId 救援任务主键
     * @return 救援任务
     */
    @Override
    public RescueMission selectRescueMissionByOrderDetailsId(Long orderDetailsId)
    {
        return rescueMissionMapper.selectRescueMissionByOrderDetailsId(orderDetailsId);
    }

    /**
     * 查询救援任务列表
     * 
     * @param rescueMission 救援任务
     * @return 救援任务
     */
    @Override
    public List<RescueMission> selectRescueMissionList(RescueMission rescueMission)
    {
        return rescueMissionMapper.selectRescueMissionList(rescueMission);
    }

    /**
     * 新增救援任务
     * 
     * @param rescueMission 救援任务
     * @return 结果
     */
    @Override
    public int insertRescueMission(RescueMission rescueMission)
    {
        rescueMission.setCreateTime(DateUtils.getNowDate());
        return rescueMissionMapper.insertRescueMission(rescueMission);
    }

    /**
     * 修改救援任务
     * 
     * @param rescueMission 救援任务
     * @return 结果
     */
    @Override
    public int updateRescueMission(RescueMission rescueMission)
    {
        return rescueMissionMapper.updateRescueMission(rescueMission);
    }

    /**
     * 批量删除救援任务
     * 
     * @param orderDetailsIds 需要删除的救援任务主键
     * @return 结果
     */
    @Override
    public int deleteRescueMissionByOrderDetailsIds(Long[] orderDetailsIds)
    {
        return rescueMissionMapper.deleteRescueMissionByOrderDetailsIds(orderDetailsIds);
    }

    /**
     * 删除救援任务信息
     * 
     * @param orderDetailsId 救援任务主键
     * @return 结果
     */
    @Override
    public int deleteRescueMissionByOrderDetailsId(Long orderDetailsId)
    {
        return rescueMissionMapper.deleteRescueMissionByOrderDetailsId(orderDetailsId);
    }
}
